<template>
  <div class="chat-header flex items-center gap-3 px-4 py-2 border-b">
    <img v-if="session" :src="session.avatar" class="w-8 h-8 rounded-full" />
    <span class="font-bold">{{ session?.name || '未选择会话' }}</span>
    <el-tag v-if="session?.online" size="small" type="success">在线</el-tag>
  </div>
</template>

<script setup>
import { computed } from 'vue'
import { useChatStore } from '@/stores/chatStore'
const chatStore = useChatStore()
const session = computed(() => {
  const id = chatStore.chattingUserInfo?.sessionId
  return chatStore.sessionList.find(s => s.sessionId === id)
})
</script>

<style scoped>
.chat-header {
  background: #f7f8fa;
  min-height: 48px;
}
</style> 